#ifndef _GENERATOR_H
#define _GENERATOR_H

#include <string>
#include <vector>
#include <map>
#include <utility>

class Generator {
  public:
    // fname should contain names of candidates.
    explicit Generator(std::string& fname);
    ~Generator() {;}

    // out is output fname,
    // ammount - number of bulls which should be generated.
    int Generate(std::string& out, unsigned ammount);

    // sets index to zero.
    inline void UpdateUndex() {
      _index = 0;
    }
    std::pair<std::string, int> GeneratePermutation();

  private:
    // for optimization purposes.
    std::vector<int> _cache;
    unsigned _index;
    std::vector<std::string> _candidates;
};

#endif  // _GENERATOR_H
